#include<iostream>
#include<unordered_set>

using namespace std;

class Solution {
public:
    bool containsDuplicate(vector<int>& nums) {
        unordered_set<int>hash;
        hash.insert(nums[0]);
        for (int i = 1; i < nums.size(); i++)
        {
            if (hash.count(nums[i]))return true;
            hash.insert(nums[i]);
        }
        return false;
    }
};